# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1063.1.6 -> 1.1063.1.7 # drivers/char/serial.c 1.40 -> 1.41 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/08/07 bjorn.helgaas@hp.com 1.1065 # Merge hp.com:/home/helgaas/linux/linux-2.4 # into hp.com:/home/helgaas/linux/to-marcelo-2.4 # -------------------------------------------- # 03/08/07 bjorn.helgaas@hp.com 1.1063.2.2 # [PATCH] HP ZX1 PCI ID update # # ===== drivers/pci/pci.ids 1.37 vs edited ===== # -------------------------------------------- # 03/08/07 bjorn.helgaas@hp.com 1.1063.1.7 # SERIAL_ACPI: add support for UARTs in IO port space. # -------------------------------------------- # diff -Nru a/drivers/char/serial.c b/drivers/char/serial.c --- a/drivers/char/serial.c Wed Oct 8 09:06:04 2003 +++ b/drivers/char/serial.c Wed Oct 8 09:06:04 2003 @@ -4680,8 +4680,8 @@ return AE_OK; } -static acpi_status acpi_serial_irq(struct serial_struct *req, - struct acpi_resource_ext_irq *ext_irq) +static acpi_status acpi_serial_ext_irq(struct serial_struct *req, + struct acpi_resource_ext_irq *ext_irq) { if (ext_irq->number_of_interrupts > 0) { #ifdef CONFIG_IA64 @@ -4694,6 +4694,28 @@ return AE_OK; } +static acpi_status acpi_serial_port(struct serial_struct *req, + struct acpi_resource_io *io) +{ + req->port = io->min_base_address; + req->io_type = SERIAL_IO_PORT; + return AE_OK; +} + +static acpi_status acpi_serial_irq(struct serial_struct *req, + struct acpi_resource_irq *irq) +{ + if (irq->number_of_interrupts > 0) { +#ifdef CONFIG_IA64 + req->irq = acpi_register_irq(irq->interrupts[0], + irq->active_high_low, irq->edge_level); +#else + req->irq = irq->interrupts[0]; +#endif + } + return AE_OK; +} + static acpi_status acpi_serial_resource(struct acpi_resource *res, void *data) { struct serial_struct *serial_req = (struct serial_struct *) data; @@ -4704,7 +4726,11 @@ if (ACPI_SUCCESS(status)) return acpi_serial_address(serial_req, &addr); else if (res->id == ACPI_RSTYPE_EXT_IRQ) - return acpi_serial_irq(serial_req, &res->data.extended_irq); + return acpi_serial_ext_irq(serial_req, &res->data.extended_irq); + else if (res->id == ACPI_RSTYPE_IO) + return acpi_serial_port(serial_req, &res->data.io); + else if (res->id == ACPI_RSTYPE_IRQ) + return acpi_serial_irq(serial_req, &res->data.irq); return AE_OK; } @@ -4721,8 +4747,8 @@ if (ACPI_FAILURE(status)) return -ENODEV; - if (!serial_req.iomem_base) { - printk("%s: no iomem address in %s _CRS\n", __FUNCTION__, + if (!serial_req.iomem_base && !serial_req.port) { + printk("%s: no iomem or port address in %s _CRS\n", __FUNCTION__, device->pnp.bus_id); return -ENODEV; }